package com.google.code.ptrends.services;

import java.sql.SQLException;
import java.util.Collection;
import java.util.Date;
import com.google.code.ptrends.common.entities.Session;
import com.google.code.ptrends.entities.ETLItem;
import com.google.code.ptrends.entities.ItemRecord;
import com.google.code.ptrends.entities.ItemValueCollection;
import com.google.code.ptrends.entities.ItemValueRecord;
import com.google.code.ptrends.entities.PriceRecord;

public interface DataService {

	ItemRecord findItem(String model, int categoryID) throws SQLException;

	ItemRecord findItem(String model) throws SQLException;

	int saveItem(ItemRecord item) throws SQLException;

	PriceRecord findLastPrice(int itemID, int SupplierID) throws SQLException;

	boolean findPrice(int itemID, int SupplierID, Date priceDate)
			throws SQLException;

	boolean saveNewPrice(PriceRecord price) throws SQLException;

	float updatePrice(PriceRecord price, float newValue) throws SQLException;

	ItemValueCollection getValues(int itemID) throws SQLException;

	boolean saveValue(int itemID, ItemValueRecord value) throws SQLException;

	int findSupplierID(final String supplierName) throws SQLException;

	int saveClass(String name) throws SQLException;

	int saveManufacturer(String name, String webSite) throws SQLException;

	void saveSession(Session session) throws SQLException;

	void persistData(Collection<ETLItem> items);

}
